public class Main {
    public static void main(String[] args) {
        Originator myOriginator = new Originator("张冠",10,114514);
        System.out.println("开始时：");
        System.out.println(myOriginator.toString());
        //用备忘录保存状态
        Memento oldStateMemento = myOriginator.createMemento();
        //修改当前状态
        myOriginator.setCurrentName("李戴");
        myOriginator.setCurrentNo(50);
        myOriginator.setCno1(101111);
        System.out.println("修改后的：");
        System.out.println(myOriginator.toString());
        myOriginator.restoreStateByMemento(oldStateMemento);
        System.out.println("恢复后的：");
        System.out.println(myOriginator.toString());
    }
}